/*
 * DictionaryCommand.java
 *
 * Copyright(c) 2010
 * Michael Kroez
 * kroez@studiorutton.de
 *
 * All rights reserved.
 *
 * $Id$
 * 
 */

package de.studiorutton.gerengdic.history;

import de.studiorutton.gerengdic.indexeddictionary.IndexedDictionaryActivity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class IndexedDictionaryCommand extends AbstractCommand implements
		ICommand {
	public static final int DICTIONARY_RUN = 20;
	private final static String bundle_package = "de.studiorutton.gerengdic.indexeddictionary";

	public final static String MY_SEARCH_STRING_KEY = bundle_package + "."
			+ SEARCH_STRING_KEY;
	public final static String MY_SEARCH_LANG_KEY = bundle_package + "."
			+ SEARCH_LANG_KEY;
	public final static String MY_SEARCH_AUTOCOMPLETE_KEY = bundle_package + "." + "Autocomplete";

	public IndexedDictionaryCommand(String searchString, int searchLang) {
		super(searchString, searchLang);
	}

	public void execute(Activity activity) {
		Intent i = new Intent(activity.getApplicationContext(),
				IndexedDictionaryActivity.class);
		Bundle b = new Bundle();
		b.putString(bundle_package + "." + SEARCH_STRING_KEY, getSearchString());
		b.putInt(bundle_package + "." + SEARCH_LANG_KEY, getSearchLang());

		i.putExtras(b);
		activity.startActivityForResult(i, DICTIONARY_RUN);
	}
}
